package config

type Config_WeChat struct {
	SendPeriod int
	EnterpriseWechat
	WechartOfficialAccount
}

type EnterpriseWechat struct {
	GetTokenURL     string
	SendMessageURL  string
	MessageTemplate string
	CorpID          string
	CorpSecret      string
}

type WechartOfficialAccount struct {
	Grant_Type      string
	AppID           string
	Secret          string
	TemplateID      string
	MessageTemplate string
	SendMessageURL  string
	GetTokenURL     string
}

var Wechat Config_WeChat

func(i *Initializer) WeChat(){
	//Wechat
	Wechat.SendPeriod = cfg.GetInt("Wechat.SendPeriod")

	//EnterpriseWechat
	Wechat.EnterpriseWechat.GetTokenURL = cfg.GetString("Wechat.EnterpriseWechat.GetTokenURL")
	Wechat.EnterpriseWechat.SendMessageURL = cfg.GetString("Wechat.EnterpriseWechat.SendMessageURL")
	Wechat.EnterpriseWechat.MessageTemplate = cfg.GetString("Wechat.EnterpriseWechat.MessageTemplate")
	Wechat.EnterpriseWechat.CorpID = cfg.GetString("Wechat.EnterpriseWechat.CorpID")
	Wechat.EnterpriseWechat.CorpSecret = cfg.GetString("Wechat.EnterpriseWechat.CorpSecret")

	//WechartOfficialAccount
	Wechat.WechartOfficialAccount.Grant_Type = cfg.GetString("Wechat.WechartOfficialAccount.Grant_Type")
	Wechat.WechartOfficialAccount.AppID = cfg.GetString("Wechat.WechartOfficialAccount.AppID")
	Wechat.WechartOfficialAccount.Secret = cfg.GetString("Wechat.WechartOfficialAccount.Secret")
	Wechat.WechartOfficialAccount.TemplateID = cfg.GetString("Wechat.WechartOfficialAccount.TemplateID")
	Wechat.WechartOfficialAccount.MessageTemplate = cfg.GetString("Wechat.WechartOfficialAccount.MessageTemplate")
	Wechat.WechartOfficialAccount.SendMessageURL = cfg.GetString("Wechat.WechartOfficialAccount.SendMessageURL")
	Wechat.WechartOfficialAccount.GetTokenURL = cfg.GetString("Wechat.WechartOfficialAccount.GetTokenURL")
}
